package com.xiangb.springbootjpa.dao;

import com.xiangb.springbootjpa.entity.Person;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author xb
 * @descripton:
 * @date 2020/12/20
 */
public interface PersonRepository extends JpaRepository<Person, Integer>, JpaSpecificationExecutor<Person> {
    /**
     *  通过年龄来查询
     *  方法名固定findByAge
     * @param age
     * @return
     */
    public List<Person> findByAge(Integer age);

    /**
     *  通过姓名来查询
     *  方法名固定findByName
     * @param age
     * @return
     */
    public Person findByName(String name);
}
